errors.Is checks if any error in the chain matches a specific sentinel error by value. errors.As checks if any error in the chain can be assigned to a specific type and extracts it.
errors.Is: comparing against sentinel errors like sql.ErrNoRows, io.EOF, context.DeadlineExceeded
errors.As: extracting typed errors to access additional fields (HTTP status code, DB error code)
Both unwrap the error chain — wrapping with %w is essential for them to work
errors.Is uses == comparison by default; implement Is(error) bool on custom types for custom matching
errors.As uses type assignability — it finds the first error in chain assignable to the target type